<script type="text/javascript" src="/js/pages/roleList.js"></script>
<th:block layout:include="fragments/ui :: main (title='角色列表')">
    <th:block layout:fragment="main-content">
        <th:block layout:include="fragments/ui :: box (title='角色列表', iconClass='fa-bars')">
            <th:block layout:fragment="box-content">
                <div class="row">
                    <div class="col-sm-2">
                        <a type="button" class="btn btn-success add_btn"><i class="fa fa-plus"></i> 添加角色</a>
                    </div>
                    <div class="col-sm-offset-8 col-sm-2">
                        <span class="input-group pull-right">
                        <input type="text" class="form-control" id="search-text" />
                            <span class="input-group-addon"><i class="fa fa-search" id="search-btn"></i></span>
                        </span>
                    </div>
                </div>
                <div th:include="fragments/ajax-table :: ajax-table (id=RoleList, head=${ {'ID', '角色名称', '描述', '状态'} }, ajaxurl='/role')"></div>
            </th:block>
        </th:block>
    </th:block>
</th:block>

<!-- add Modal -->
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">新建角色</h4>
            </div>
            <div class="modal-body">
                <form id="addRoleForm" class="form-horizontal" method="post">
                    <div class="form-group">
                        <label for="add_name" class="col-sm-2 control-label">角色名称</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="add_name" name="name" placeholder="角色名称" value="" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="add_info" class="col-sm-2 control-label">描述</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="add_info" name="info" placeholder="描述" value="" />
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default btn-flat" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-success btn-flat add_btn_save">保存</button>
            </div>
        </div>
    </div>
</div>